<?php
namespace Users\Login\Helper;

use Users\Helper\SmartRedirect;

/**
 * 
 * @author kosh
 *
 * @uses \Pinenut\Action
 *
 */
trait AfterLogin {
	
	function afterLogin() {
		$url = '/';
		
		$smartRedirectUrl = SmartRedirect::getRedirectPoint();
		if ($smartRedirectUrl !== null) {
			$url = $smartRedirectUrl;
			SmartRedirect::clearRedirectPoint();
		}
		
		$this->redirect($url);
	}
}